﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="KMrpt6.aspx.cs" Inherits="KMrpt6" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>微信对账表</title>
    <style>
        .x-grid-row-over .x-grid-cell-inner
        {
            font-weight: bold;
        }
        .x-column-header-inner
        {
            height: 28px;
            background: #E7EBEF url(./images/header.png) repeat-x 0 0;
        }
    </style>
    <script>
        var template = '<span style="color:{0};">{1}</span>';

        var change = function (value) {
            return Ext.String.format(template, (value > 0) ? "green" : "red", value);
        };

        var pctChange = function (value) {
            return Ext.String.format(template, (value > 0) ? "green" : "red", value + "%");
        };
        //导出EXCEL
        var exportData = function (format) {
            App.FormatType.setValue(format);
            var store = App.GridPanel1.store;

            store.submitData(null, { isUpload: true });
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Crisp" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="FitLayout">
            <Items>
                <ext:Hidden ID="FormatType" runat="server" />
                <ext:GridPanel ID="GridPanel1" runat="server" TitleAlign="Center">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server">
                            <Items>
                                <ext:DateField runat="server" ID="txtbdate" FieldLabel="开始日期" />
                                <ext:DateField runat="server" ID="txtedate" FieldLabel="结束日期" />
                                <ext:MultiCombo ID="comShop" runat="server" SelectionMode="All" FieldLabel="店铺"
                                 DisplayField="shopname" ValueField="shopid" >
                                    <Store>
                                        <ext:Store ID="Store2" runat="server">
                                            <Model>
                                                <ext:Model ID="Model2" runat="server">
                                                    <Fields>
                                                        <ext:ModelField Name="shopid" />
                                                        <ext:ModelField Name="shopcode" />
                                                        <ext:ModelField Name="shopname" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                </ext:MultiCombo>
                                <ext:Button ID="Button1" runat="server" Text="查询" OnDirectClick="BtnQureyUser" UI="Info">
                                    <DirectEvents>
                                        <Click>
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="100" OnReadData="RefreshDataSet" OnSubmitData="Store1_Submit">
                            <Model>
                                <ext:Model ID="Model1" runat="server">
                                    <Fields>
                                        <ext:ModelField Name="日期" />
                                        <ext:ModelField Name="公司代码" />
                                        <ext:ModelField Name="POS单号" />
                                        <ext:ModelField Name="店铺名称" />
                                        <ext:ModelField Name="订单总金额" />
                                        <ext:ModelField Name="微信支付金额" />
                                        <ext:ModelField Name="微信支付流水号" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
                    </SelectionModel>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label1" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="10" />
                                        <ext:ListItem Text="20" />
                                        <ext:ListItem Text="50" />
                                        <ext:ListItem Text="100" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="50" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button2" runat="server" Text="导出Excel" Icon="PageExcel">
                                    <Listeners>
                                        <Click Handler="exportData('xls');" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                </ext:GridPanel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
